<template>
  <div>
    <p v-for="item of hots" :key="item" @click="changeCity(item)">{{ item }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      hots: ["武汉", "广州", "上海"],
    };
  },
  methods: {
    changeCity(val) {
      this.$store.dispatch("changeCity", val);
      this.$router.back();
    },
  },
};
</script>

<style>
</style>